<template>
  <div class="scrol" :class="`${siderBarControl ? 'isShow': 'notShow'}`">
    <div class="traffic hideScrollBar">
      <div>
        <div class="roadNameTitles">直大方伯:庆春路-解放路路段(北向南)</div>
        <div class="roadNames">
          <div class="roadNameDir">
            <span class="roadNameDirIcon"></span>
            <p class="roadLeftName">庆春路与直大方伯岔口</p>
            <p class="roadRightName">直大方伯与金鸡岭路口</p>
          </div>
          <div class="roadNameJam">常发拥堵路段</div>
        </div>
      </div>
      <div class="roadBasicInfo">
        <div class="roadBasicInfoTitle">
          <img src="../../assets/img/slices/g18.png" />
          <span class="roadNumber">基础信息</span>
        </div>
        <div class="roadBasicInfoDetail">
          <div class="roadBasicBox">
            <p class="roadBasicBoxName">路段长度</p>
            <p class="roadBasicBoxValue">
              <span class="roadBasicInfoValue">{{formData.rid_length}}</span><span class="roadBasicInfoValueUnit"> m</span>
            </p>
          </div>
          <div class="roadBasicBox">
            <p class="roadBasicBoxName">类型</p>
            <p class="roadBasicBoxValue">
              <span class="roadBasicInfoValue">{{formData.type}}</span><span class="roadBasicInfoValueUnit"> </span>
            </p>
          </div>
          <div class="roadBasicBox">
            <p class="roadBasicBoxName">道路等级</p>
            <p class="roadBasicBoxValue">
              <span class="roadBasicInfoValue">{{formData.road_level}}</span><span class="roadBasicInfoValueUnit"> </span>
            </p>
          </div>
          <div class="roadBasicBox" style="margin-top: 25px;">
            <p class="roadBasicBoxName">道路横断面</p>
            <p class="roadBasicBoxValue">
              <span class="roadBasicInfoValue" v-if="formData.lane_cnt">{{formData.lane_cnt}}</span><span class="roadBasicInfoValueUnit"> 车道</span>
            </p>
          </div>
          <div class="roadBasicBox" style="margin-top: 25px;">
            <p class="roadBasicBoxName">拥堵频次</p>
            <p class="roadBasicBoxValue">
              <span class="roadBasicInfoValue">{{formData.congestion_num}}</span><span class="roadBasicInfoValueUnit"> 次/天</span>
            </p>
          </div>
          <div class="roadBasicBox" style="margin-top: 25px;">
            <p class="roadBasicBoxName">常发拥堵时段</p>
            <p class="timeSlot">
              <span v-for="(item, index) in formData.time_frame.split(',')" class="roadBasicInfoValue roadBasicInfoValueTime" :key="index">{{item}}</span>
            </p>
          </div>
          <div class="roadBasicInfoLine" style="height: 146px"></div>
          <div class="roadBasicInfoLinet" style="height: 146px"></div>
        </div>
      </div>
      <div class="roadBasicInfo">
        <div class="roadBasicInfoTitle">
          <img src="../../assets/img/slices/g12.png" alt="" />
          <span class="roadNumber">路段高峰数据</span>
        </div>
        <div class="operateEfficDetail">
          <div class="operateEfficDetailLeft">
            <div class="operateEfficDetailItem" v-for="item in indexData" :key="item.type">
              <p class="operateEfficDetailTop">
                <span>{{item.title}}</span>
              </p>
              <p style="font-size: 20px; margin-top: 6px; line-height: 32px;">
                {{item.index}}
                <span class="operateEfficUnit">{{item.unit}}</span>
              </p>
            </div>
          </div>
        </div>
      </div>
      <div class="roadBasicInfo">
        <div class="roadBasicInfoTitle" style="justify-content: space-between;">
          <div style="display: flex; align-items: center;">
            <img src="../../assets/img/slices/g23.png" />
            <span class="roadNumber">致因分析</span>
          </div>
          <!-- <div style="margin-right: 20px;" @click="isOdTable = !isOdTable">
            <img v-if="isOdTable" src="../../assets/img/slices/b3.png" alt=""/>
            <img v-if="!isOdTable" src="../../assets/img/slices/b4.png" alt=""/>
          </div> -->
          <div style="margin-right: 20px; height: 100%;" @click="isOdTable = !isOdTable">
            <img v-if="isOdTable" style="width: 20px; height: 20px;" src="../../assets/img/slices/g16.png" alt=""/>
            <img v-if="!isOdTable" style="width: 20px; height: 20px;" src="../../assets/img/slices/g17.png" alt=""/>
          </div>
        </div>
        <div class="odTable" :class="isOdTable ? 'actTable' : ''">
          <!-- <el-select class="analyseBtn" v-if="options.length > 1" @change="changeSel" v-model="optionValue">
            <el-option
              v-for="item in options"
              :key="item.id"
              :label="item.name"
              :value="item.id">
            </el-option>
          </el-select> -->
          <template>
            <!-- <Radar ref="radar" @radarClick="radarClick" @delayClick="delayClick" @restore="restore" @peakClick="peakClick" :list="list"></Radar> -->
          </template>
          <template>
            <!-- <WhiteRadar ref="whiteRadar" @radarClick="radarClick" @delayClick="delayClick" @restore="restore" @peakClick="peakClick" :list="list"></WhiteRadar> -->
          </template>
          <!-- <BusList :type="'fast'" v-show="showBusList" ref="busList" @busListClick="busListClick"></BusList> -->
          <!-- <FoldLine v-show="showFoldLine" ref="foldLine"></FoldLine> -->
          <div v-show="cause" class="sumCase">
            <img src="../../assets/img/slices/b8.png" alt="" />
            <div v-html="cause"></div>
          </div>
        </div>
        <div v-if="showRes">
          <div class="roadAll" v-if="tabIndex == 1">
            <!-- <Road :tfcdline_id="formData.tfcdline_id" :dt="dt" :work="work" :list="list" :tabIndex="tabIndex" @showLegend="showLegend" @checkLines="checkLines" @itemclick="itemclick" :removeIcon="removeIcon" ref="road"></Road> -->
          </div>
          <div class="roadAll" v-if="tabIndex == 2">
            <!-- <Road :tfcdline_id="formData.tfcdline_id" :dt="dt" :work="work" :list="list" :tabIndex="tabIndex" @showLegend="showLegend" @checkLines="checkLines" @itemclick="itemclick" :removeIcon="removeIcon" ref="road"></Road> -->
          </div>
            <div class="roadAll" v-if="tabIndex == 3">
            <!-- <Road :tfcdline_id="formData.tfcdline_id" :dt="dt" :work="work" :list="list" :tabIndex="tabIndex" @showLegend="showLegend" @checkLines="checkLines" @itemclick="itemclick" :removeIcon="removeIcon" ref="road"></Road> -->
          </div>
          <div class="roadSafe" v-show="showNo">
            <li>根据目前数据计算，未诊断出问题。</li>
          </div>
        </div>
      </div>
    </div>
    <div
      class="sideBar sideBarRely"
      @click="siderBarControl= !siderBarControl"
    >
      <img v-if="siderBarControl" src="../../assets/img/slices/b12.png" />
      <img v-else src="../../assets/img/slices/b11.png" />
    </div>
    <div
     
      class="sideBar"
      @click="siderBarControl= !siderBarControl"
    >
      <img v-if="siderBarControl" src="../../assets/img/slices/l9.png"  alt=""/>
      <img v-else src="../../assets/img/slices/l10.png" alt="" />
    </div>
    <div v-if="travelSumControl" class="father-infowindow travelSumBox">
      <div class="infowindowBody">该路段在&nbsp;{{ timeSlice }}&nbsp;间过境交通总量：{{travelSum}}辆</div>
    </div>
    <div class="channelMap" v-if="reactCrossControl">
      <!-- <MyReactComponent :message="$store.state.backTheme" ref="reactCom" :data="{width: 900, height: 600,  data: crossFormData, iframeData: iframeData }" /> -->
      <span class="reactClose" @click="reactClose">+</span>
    </div>
    <div v-if="aoiOdControl" class="father-infowindow aoiOdSumBox">
      <div class="aoiOdType">AOI区域图例</div>
      <div class="aoiOdType"><span class="aoiOdType_span" style=" background-color: #FF6347;"></span>学校校区</div>
      <div class="aoiOdType"><span class="aoiOdType_span" style=" background-color: #00BFFF;"></span>办公场所</div>
      <div class="aoiOdType"><span class="aoiOdType_span" style=" background-color: #FFD700;"></span>商业广场</div>
      <div class="aoiOdType"><span class="aoiOdType_span" style=" background-color: #FFE4E1;"></span>医疗设施</div>
      <div class="aoiOdType"><span class="aoiOdType_span" style=" background-color: #00FF00;"></span>景点景区</div>
      <div class="aoiOdType"><span class="aoiOdType_span" style=" background-color: #1163FF;"></span>住宅小区</div>
      <div class="aoiOdType"><span class="aoiOdType_span" style=" background-color: #b1b1b1;"></span>其他类型</div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { reactive, ref, onMounted, watch } from 'vue'
  const formData = reactive({
    rid_length: 100,
    type: '地面道路',
    road_level: 44000,
    lane_cnt: 4.33,
    congestion_num: 200,
    time_frame: '16:30-18:30'
  })
  const isOdTable = ref(false)
  const showRes = ref(false)
  const indexData = ref([])
  const cause = ref([])
  const siderBarControl = ref(false)
  const travelSumControl = ref(false)
  const reactCrossControl = ref(false)
  const aoiOdControl = ref(false)
</script>

<style lang="less" scoped>
.scrol{
  position: fixed;
  top: 16px;
  z-index: 9;
  transition: all 0.5s;
}
.traffic{
  width: 414px;
  height: calc(100vh - 16px);
  background: #FFF;
  color: #333333;
  font-family: 'AlibabaPuHuiTi_2_65_Medium';
  font-style: normal;
  font-weight: 400;
  position: absolute;
  z-index: 10;
  margin-top: 0;
  padding: 0 0 20px 0;
  box-sizing: border-box;
  border-radius: 5px 5px 0 0;
  .roadBasicInfo{
    .roadBasicInfoTitle{
      background: transparent;
      width: 100%;
      height: 44px;
      padding: 12px 0 12px 18px;
      box-sizing: border-box;
      position: relative;
      display: flex;
      align-items: center;
      img{
        width: 22px;
        height: 21px;
      }
      .roadNumber{
        color: #1163FF;
        font-size: 20px;
        margin-left: 15px;
      }
    }
    .roadBasicInfoTitle::after{
      content: "";
      width: 414px;
      height: 3px;
      opacity: 0.65;
      bottom: 0;
      left: 0;
      position: absolute;
    }
    .roadBasicInfoDetail{
      padding: 14px 20px;
      box-sizing: border-box;
      display: flex;
      flex-wrap: wrap;
      justify-content: space-between;
      position: relative;
      .roadBasicBox{
        width: 120px;
        height: 59px;
        text-align: center;
        .roadBasicBoxName{
          background: #eeeeee;
          border-radius: 9px;
          width: 97px;
          height: 18px;
          box-sizing: border-box;
          text-align: center;
          line-height: 18px;
          font-size: 13px;
          font-family: 'AlibabaPuHuiTi_2_55_Regular';
          margin: 0 auto;
          color: #333333;
        }
        .timeSlot{
          height: auto;
          overflow-y: scroll;
          overflow-x: hidden;
          margin-top: 2px;
          font-size: 14px;
          font-family: 'AlibabaPuHuiTi_2_55_Regular';
          color: #1163FF;
          height: 52px;
          width: 98px;
          span{
            display: block;
            width: 100%;
            text-align: center;
            line-height: 17px;
          }
        }
        .timeSlot::-webkit-scrollbar{
          background: transparent;
          width: 4px;
          border-radius: 4px;
        }
        .timeSlot::-webkit-scrollbar-thumb{
          width: 4px;
          border-radius: 4px;
          background: rgb(179, 156, 156);
        }
        .roadBasicBoxValue{
          margin-top: 6px;
          .roadBasicInfoValue{
            width: 46px;
            height: 35px;
            font-size: 28px;
            font-family: 'PingFangSC, PingFang SC';
            font-weight: 600;
            color: #1163FF;
            line-height: 35px;
            background: linear-gradient(180deg, #EEEEEE 0%, #1163FF 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
          }
          .roadBasicInfoValueUnit{
            color: #999999;
            font-size: 14px;
            line-height: 22px;
          }
          img{
            width: 28px;
            height: 28px;
          }
        }
      }
      .roadBasicInfoLine{
        position: absolute;
        border: 1px solid rgba(196, 196, 196, 0.5);
        left: 143px;
      }
      .roadBasicInfoLinet{
        position: absolute;
        border: 1px solid rgba(196, 196, 196, 0.5);
        right: 143px;
        height: 146px;
      }
    }
    .operateEfficDetail{
      padding: 5px 0;
      .operateEfficDetailItem{
        width: 135px;
        height: 79px;
        color: #333;
        border-radius: 0;
        padding: 10px 4px 10px 5px;
        background: #F7F8FA;
        box-sizing: border-box;
        .operateEfficDetailTop{
          font-size: 12px;
          color: #333;
          font-family: 'AlibabaPuHuiTi_2_55_Regular';
          display: flex;
          justify-content: space-between;
          font-size: 12px;
          .el-icon-warning-outline{
            cursor: pointer;
          }
        }
        .operateEfficDetailNum{
          font-size: 22px;
          margin-top: 6px;
          line-height: 32px;
        }
        .operateEfficDetailBottom{
          font-size: 22px;
          font-family: 'DIN, DIN';
          font-weight: bold;
          .operateEfficUnit{
            font-size: 14px;
            font-family: 'AlibabaPuHuiTi_2_55_Regular';
          }
        }
      }
      .operateEfficDetailItem:nth-child(1){
        width: 127px;
      }
      .operateEfficDetailItem:nth-child(2){
        width: 122px;
      }
      .operateEfficDetailItem:nth-child(3){
        width: 118px;
      }
    }
    .numSubmenu{
      transition: all 0.3s;
      height: 0;
      overflow: hidden;
    }
    .actTable{
      height: auto;
    }
  }
}
.analyseRoadBasicInfo{
  margin-bottom: 8px;
}
.roadBasicInfoDetail{
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}
.roadBasicInfoDetail>p{
  background: #F7F8FA;
  border-radius: 5px;
  width: 144px;
  height: 32px;
  box-sizing: border-box;
  margin-top: 16px;
  line-height: 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 8px;
  font-size: 12px;
}

.roadBasicInfoDetail .lastBox{
  width: 113px;
  height: 0;
  border: none;
  margin: 0;
  background: transparent;
}
.roadBasicInfoDetail .roadBasicInfoValue{
  font-size: 16px;
  color: #1163FF;
}

.roadBasicInfoDetail .usualJam{
  width: 175px;
  white-space: nowrap;
  padding: 5px 8px;
  display: flex;
  justify-content: space-between;
}

.roadBasicInfoDetail .roadBasicInfoValueTime{
  line-height: 13px;
  font-size: 12px;
  margin-left: 5px;
}
.roadNumber{
  margin-left: 8px;
}
.operateEffic{
  margin-top: 16px;
}
.operateEffic .operateEfficDetail{
  margin-top: 16px;
  width: 434px;
  height: 64px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.operateEfficDetailLeft{
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  box-sizing: border-box;
}
.operateEfficUnit{
  font-size: 12px;
  color: #999999;
}
.operateEfficDetailRight{
  position: relative;
  cursor: pointer;
}
.operateEfficDetailRight .roadEva{
  position: absolute;
  font-size: 10px;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
}
.analyse{
  margin-top: 24px;
  position: relative;
}
.analyseBtn{
  margin: 20px 20px 8px auto;
  width: 300px;
  display: flex;
  &::deep.el-input__inner{
    height: 32px;
    border-color: #a0a7ad;
  }
  &::deep .el-select__caret{
    line-height: 32px;
  }
}
.analyseBtn>li{
  width: 44px;
  height: 32px;
  border: 1px solid #E8ECEF;
  border-radius: 4px;
  background: #FFFEFE;
  text-align: center;
  line-height: 32px;
  font-size: 12px;
  cursor: pointer;
}
.analyseBtn .analyseBtnLeftActive{
  color: #FFF;
  background: #1163ff;
}
.sumCase{
  font-family: 'AlibabaPuHuiTi_2_65_Medium';
  line-height: 22px;
  padding: 16px;
  font-size: 16px;
  background: #F7F8FA;
  // border: 1px solid #e8e8e8;
  border-radius: 5px;
  margin: 0 20px;
  position: relative;
  img{
    position: absolute;
    right: 0;
    top: 0;
    width: 120px;
    height: 45px;
  }
}
.sumCase::deep p{
  word-break: break-all;
  color: #333;
}
.roadAll{
  padding: 0 20px;
}
.sideBar{
  position: absolute;
  top: 0;
  left: -60px;
  z-index: 3;
  background-color: #FFF;
  cursor: pointer;
}

.sideBar img{
  width: 42px;
  height: 42px;
  position: absolute;
}
.sideBarRely{
  left: -30px;
  top: 60px;
  z-index: 10;
  width: 28px;
  height: 50px;
  background: rgba(144, 147, 153, 0.3);
  // box-shadow: 0px 0 7px 0px rgba(0, 0, 0, 0.22);
  border-radius: 6px 0 0 6px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  border-right: none;
  img{
    width: 20px;
    height: 20px;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
  }
}
.isShow{
  right: 434px;
}
.notShow{
  right: 0px;
}
.traTable{
  position: absolute;
  top: 0;
  left: 10px;
  z-index: -1;
  background-color: #FFF;
  transition: all 0.3s;
  display: none;
}
.showTra{
  left: -310px;
  z-index: 9;
  display: block;
}
.roadSafe{
  display: flex;
  width: 394px;
  height: 40px;
  box-sizing: border-box;
  align-items: center;
  font-size: 12px;
  color: rgb(17, 99, 255);
  background: rgba(51, 70, 129, 0.04);
  border-radius: 4px;
  margin: 10px 0 0 16px;
  padding: 0 0 0 10px;
}
.roadSafe li{
  list-style: unset;
}
.travelSumBox{
  position: fixed;
  bottom: 15px;
  right: 490px;
}
.aoiOdSumBox{
  position: fixed;
  bottom: 15px;
  right: 454px;
  border: 2px solid rgba(200, 209, 244, 0.9);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0px 0 7px 0px rgba(0,0,0,0.22);
  border-radius: 21px;
  backdrop-filter: blur(16px);
  padding: 20px;
  font-family: 'PingFangSC, PingFang SC';
  width: 86px;
  color: #868686;
  font-weight: 600;
  .aoiOdType{
    line-height: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
}
.aoiOdType span{
  display: inline-block;
  width: 18px;
  height: 9px;
  border-radius: 2px;
  vertical-align: revert;
  margin-right: 5px;
}
.channelMap{
  position: fixed;
  top: 50%;
  left: 50%;
  margin-top: -230px;
  margin-left: -450px;
  overflow: hidden;
}
.reactClose{
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-block;
  font-size: 30px;
  line-height: 16px;
  color: #fad507;
  transform: rotate(45deg);
  cursor: pointer;
}
.odTable{
  transition: all 0.3s;
  height: 0;
  overflow: hidden;
}
.actTable{
  height: auto;
}
.scrol .el-menu-vertical-table{
  position: absolute;
  right: 0;
  &::deep .el-submenu__title {
    color: #333;
    width: 96px;
    height: 30px;
    line-height: 30px;
  }
  &::deep .el-submenu__title:hover {
    background: transparent;
  }
  &::deep .el-submenu__icon-arrow{
    color: #1163FF;
    font-size: 20px;
    top: 49%;
  }
}
.roadNameTitles{
  color: #333333;
  font-family: 'AlibabaPuHuiTi_2_85_Bold';
  font-size: 20px;
  padding: 20px 20px 0;
  text-align: left;
}
.roadNames{
  padding: 10px 46px 10px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  .roadNameDir{
    position: relative;
    margin-left: 16px;
    max-width: 220px;
  }
  .roadNameDir>p{
    font-size: 12px;
    color: #868686;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  .roadLeftName{
    margin-bottom: 4px;
  }
  .roadNameDirIcon{
    position: absolute;
    left: -6px;
    top: 50%;
    width: 1px;
    height: 50%;
    background: #cccccc;
    transform: translateY(-50%);
  }
  .roadNameDirIcon::before{
    content: '';
    width: 3px;
    height: 3px;
    border-radius: 50%;
    display: block;
    position: absolute;
    left: -1.8px;
    top: -4px;
    border: 1px solid #868686;
  }
  .roadNameDirIcon::after{
    content: '';
    width: 3px;
    height: 3px;
    border-radius: 50%;
    display: block;
    position: absolute;
    left: -1.8px;
    bottom: -4px;
    border: 1px solid #868686;
  }
  .roadNameJam{
    background: #FF7E33;
    border-radius: 2px;
    width: 104px;
    height: 20px;
    font-size: 12px;
    color: #FFF;
    text-align: center;
    line-height: 20px;
    font-family: 'PingFang SC';
    margin-left: 12px;
    flex-shrink: 0;
  }
}

</style>
